Admin Operations

This guide covers administrative operations for the WTDSale contract.

Roles

Role
Purpose

DEFAULT_ADMIN_ROLE

Configure rounds, activate/deactivate rounds

MULTI_SIG_ROLE

Set round recipients, withdraw funds

Note: MULTI_SIG_ROLE is the admin of DEFAULT_ADMIN_ROLE in this contract. The MULTI_SIG_ROLE holder manages who has DEFAULT_ADMIN_ROLE.

Setup Workflow

1

Configure a Round

configureRound(round, priceUSDC, priceUSDT, priceETH, allocation)
  • round: 0 (Seed), 1 (Private), or 2 (Public)

  • priceUSDC: Price per WTD in USDC (6 decimals)

  • priceUSDT: Price per WTD in USDT (6 decimals)

  • priceETH: Price per WTD in USD for ETH purchases (18 decimals)

  • allocation: Total WTD tokens available in this round (18 decimals)

Access: DEFAULT_ADMIN_ROLE

circle-exclamation
2

Set Round Recipient

setRoundRecipient(round, recipient)

Sets the withdrawal address for a round. This should be the team's multisig wallet.

Access: MULTI_SIG_ROLE

3

Activate a Round

setRoundActive(round, true)

Opens the round for purchases.

Access: DEFAULT_ADMIN_ROLE

4

Deactivate a Round

setRoundActive(round, false)

Stops new purchases. Can be reactivated later.

Access: DEFAULT_ADMIN_ROLE

Withdrawing Funds

Funds are withdrawn per round to the configured round recipient.

Withdraw USDC

withdrawUSDC(round, amount)

Pass amount = 0 to withdraw all available USDC for the round.

Withdraw USDT

withdrawUSDT(round, amount)

Pass amount = 0 to withdraw all available USDT for the round.

Withdraw ETH

withdrawETH(round, amount)

Pass amount = 0 to withdraw all available ETH for the round.

Withdraw All Funds for a Round

withdrawRoundFunds(round)

Withdraws all available USDC, USDT, and ETH for the specified round in a single transaction.

Access: All withdrawal functions require MULTI_SIG_ROLE.

View Functions

Function
Description

getRoundInfo(round)

Get full round configuration and status

getUserPurchase(user, round)

Get a user's purchase details for a round

getUserPurchaseAllRounds(user)

Get a user's purchases across all rounds

getWithdrawableUSDC(round)

Get withdrawable USDC amount

getWithdrawableUSDT(round)

Get withdrawable USDT amount

getWithdrawableETH(round)

Get withdrawable ETH amount

getTotalRaisedAllTokens(round)

Get total raised amounts (USDC, USDT, ETH)

getRoundRecipient(round)

Get withdrawal recipient for a round

isRoundConfigured(round)

Check if a round has been configured

getETHPrice()

Get current ETH/USD price from Chainlink